package com.ocom.common.utils.yct;


import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.google.gson.Gson;
import com.ocom.common.utils.CommonUtil;
import com.ocom.common.utils.DateUtil;
import com.ocom.common.vo.emqx.YctDataVo;
import com.ocom.common.vo.recode.YtcResult;
import com.ocom.common.vo.recode.hs1ResultDataDataVo;
import com.ocom.common.vo.recode.hsResultDataDataVo;
import com.ocom.common.vo.recode.ymResultDataDataVo;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import sun.misc.BASE64Decoder;

import java.util.*;


public class YctDataParse {

	private static final Logger logger = LoggerFactory.getLogger(YctDataParse.class);

	public static YctDataVo parse(String base64str){
		JSONObject jsonObject ;
		try {
			jsonObject = JSON.parseObject(base64str);
		}catch (Exception e){
			logger.info("解析羊城通数据 非新版数据  数据：【{}】 异常：【{}】",base64str,e.getMessage());
			return parse1(base64str);
		}

		YctDataVo yctDataVo=new YctDataVo();
		try {

			String errcode=jsonObject.getString("errcode");

			if(!errcode.equals("000000")){
				logger.info("新版数据解析羊城通数据 非00000  数据：【{}】",base64str);
				return yctDataVo;
			}

			String colourstatus=jsonObject.getString("colourstatus");
			if(colourstatus.equals("0")){
				yctDataVo.setCodeColor("绿");
			}
			if(colourstatus.equals("1")){
				yctDataVo.setCodeColor("红");
			}
			if(colourstatus.equals("2")){
				yctDataVo.setCodeColor("黄");
			}

			yctDataVo.setColorTime(DateUtil.getDateTime());

			String name=jsonObject.getString("name");
			yctDataVo.setPName(name);

			String hsstatus=jsonObject.getString("hsstatus");
			if(hsstatus.equals("0")){
				yctDataVo.setHsResult("阴性");
			}
			if(hsstatus.equals("1")){
				yctDataVo.setHsResult("阳性");
			}

			String hsjcsj=jsonObject.getString("hsjcsj");
			yctDataVo.setHsTime(hsjcsj);

			String ymtimes=jsonObject.getString("ymtimes");
			if(!CommonUtil.isNull(ymtimes)){
				yctDataVo.setYmNum(Integer.valueOf(ymtimes));
			}

			String ymzssj=jsonObject.getString("ymzssj");
			yctDataVo.setYmTime(ymzssj);


			if(CommonUtil.isNull(yctDataVo.getHsTime())){
				yctDataVo.setHsTime(DateUtil.getDateTime());
			}

			if(CommonUtil.isNull(yctDataVo.getYmTime())){
				yctDataVo.setYmTime(DateUtil.getDateTime());
			}

			String xcdata=jsonObject.getString("xcdata");
			yctDataVo.setReason(xcdata);

			/**
			 * errcode String 是 “000000”:成功，其 他异常 errmsg String 是 错误描述
			 * colourstatus String 否 健康码状态 ”0” 为绿码 “1” 为红码 “2” 为黄码
			 * name String 否 如果有，则为姓名首 字+”*”
			 * hsstatus String 否 核酸状态 “0”：阴性 “1”： 阳性
			 * hscysj String 否 核酸采样时间
			 * hsjcsj String 否 核酸检测时间
			 * ymtimes String 否 疫苗针次
			 * ymzssj String 否 疫苗注射时间
			 * xcdata String 否 行程数据
			 */

		}catch (Exception e){
			logger.info("新版羊城通数据解析异常99  数据：【{}】 异常：【{}】",base64str,e.getMessage());
		}
		if(yctDataVo.getReason()==null){
			yctDataVo.setReason("");
		}
		return yctDataVo;
	}

	public static YctDataVo parse1(String base64str){

		final BASE64Decoder decoder = new BASE64Decoder();
		Gson gson = new Gson();
		YctDataVo yctDataVo=new YctDataVo();
		try {
			String uy = new String(decoder.decodeBuffer(base64str), "UTF-8");
			Map<String, Object> map1 = gson.fromJson(uy, Map.class);
			List<Map> list = gson.fromJson((String) map1.get("data"), List.class);
			Map<String, Object> stringObjectMap = new HashMap<>();
			for (Map<String, Object> map2 : list) {
				for (Map.Entry entry : map2.entrySet()) {
					stringObjectMap.put((String) entry.getKey(), entry.getValue());
				}
			}
			YtcResult ytcResult= JSON.parseObject(JSON.toJSONString(stringObjectMap),YtcResult.class);

			try {
				yctDataVo.setReason(ytcResult.getYkmResult().getData().getData().get(0).getRYLXXXSM());
			}catch (Exception e){
			}


			String idCard ="";
			try {
				idCard = ytcResult.getSqfydsryResult().getIdentityNum();
			}catch (Exception e){
			}
			if(idCard.equals("")){
				try {
					idCard = ytcResult.getIdentityResult().getIdentity();
				}catch (Exception e){
				}
			}
			yctDataVo.setIdCard(idCard);
			try {
				yctDataVo.setPName(ytcResult.getSqfydsryResult().getName());
			}catch (Exception e){
			}
			try{
				yctDataVo.setPPhone(ytcResult.getHsResult().getData().getData().get(0).getSJHM());
			}catch (Exception e){
			}
			try{
				yctDataVo.setCodeColor(ytcResult.getYkmResult().getData().getData().get(0).getJKMYS());
			}catch (Exception e){
			}
			try{
				yctDataVo.setColorTime(ytcResult.getYkmResult().getData().getData().get(0).getPDSJ());
			}catch (Exception e){
			}
			if(CommonUtil.isNull(yctDataVo.getColorTime())){
				try{
					yctDataVo.setColorTime(ytcResult.getSkmResult().getData().getCheckTime());
				}catch (Exception e){
				}
			}
			if(CommonUtil.isNull(yctDataVo.getColorTime())){
				yctDataVo.setColorTime(DateUtil.getDateTime());
			}
			Date hs1=null;  //时间
			String hs2="";	//结果
			try {
				List<hsResultDataDataVo> data34= ytcResult.getHsResult().getData().getData();
				for (hsResultDataDataVo vo:data34){
					Date t= DateUtil.getDate(vo.getJCJGTBSJ(),"yyyy-MM-dd HH:mm:ss");
					if(hs1==null || hs1.compareTo(t)<0){
						hs1=t;
						hs2=vo.getJCJG();
					}
				}
			}catch (Exception e){
			}
			try {
				List<hs1ResultDataDataVo> data78= ytcResult.getHs1Result().getData().getData();
				try {
					for (hs1ResultDataDataVo vo:data78){
						Date t= DateUtil.getDate(vo.getJc_rq(),"yyyy-MM-dd HH:mm:ss");
						if(hs1==null || hs1.compareTo(t)<0){
							hs1 = t;
							hs2=vo.getJcjg();
						}
					}
				}catch (Exception e){
				}
			}catch(Exception e){

			}
			if(hs1!=null){
				yctDataVo.setHsResult(hs2);
				yctDataVo.setHsTime(DateUtil.getDateTime(hs1));
			}else{
				yctDataVo.setHsResult("未核酸");
				yctDataVo.setHsTime(DateUtil.getDateTime());
			}
			Date ymTime=null;  //时间
			List<ymResultDataDataVo> data56 =null;
			try {
				data56 = ytcResult.getYmResult().getData().getData();
				for (ymResultDataDataVo vo:data56){
					Date t= DateUtil.getDate(vo.getInoculationdate(),"yyyy-MM-dd");
					if(ymTime==null || ymTime.compareTo(t)<0){
						ymTime=t;
					}
				}
			}catch (Exception e){
			}
			if(data56!=null && data56.size()>0){
				yctDataVo.setYmNum(data56.size());
			}else{
				yctDataVo.setYmNum(0);
			}
			if(ymTime!=null){
				yctDataVo.setYmTime(DateUtil.getDateTime(ymTime));
			}else{
				yctDataVo.setYmTime(DateUtil.getDateTime());
			}
		}catch (Exception e){
			logger.info("门禁记录上传##解析羊城通异常2:请求参数:【{}】,返回参数:【{}】",base64str,e.getMessage());
			return null;
		}
		if(yctDataVo.getReason()==null){
			yctDataVo.setReason("");
		}
		return  yctDataVo;
	}

	public static void main(String[] yt){
	//	String td="eyJkYXRhIjoiW3tcImhzMV9yZXN1bHRcIjp7XCJlcnJjb2RlXCI6MCxcImRhdGFcIjp7XCJtZXRhZGF0YVwiOntcInRvdGFsXCI6XCIzXCJ9LFwiZGF0YVwiOlt7XCJqY19ycVwiOlwiMjAyMi0wNS0xMCAwMDowNzozOVwiLFwiZ2pcIjpcIuS4reWbvVwiLFwiempseFwiOlwi5bGF5rCR6Lqr5Lu96K+BXCIsXCJqY19qZ1wiOlwi5bm/5bee55m95LqR5LqR5bq36L6+5a6J5Yy75a2m5qOA6aqM5a6e6aqM5a6kXCIsXCJqY2pnXCI6XCLpmLTmgKdcIixcInpqaG1cIjpcIjM3MDk4MjIwMDEwNzA4ODA1MVwiLFwieHh6amJoXCI6XCI0MTJlMDljOTgyMmY0MGJlOTFmOTMxN2Q0NThlNmVlY1wiLFwiY2pfcnFcIjpcIjIwMjItMDUtMDkgMTY6NDU6MTlcIixcInhtXCI6XCLojIPplb/lvoFcIn0se1wiamNfcnFcIjpcIjIwMjItMDUtMDkgMDQ6NDY6NDNcIixcImdqXCI6XCLkuK3lm71cIixcInpqbHhcIjpcIuWxheawkei6q+S7veivgVwiLFwiamNfamdcIjpcIuW5v+W3nueZveS6keS6keW6t+i+vuWuieWMu+Wt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ixcIm5hbWVcIjpcIuael+mUpuWugVwifSx7XCJ2YWxpZGl0eWRhdGVcIjpcIjIwMjMtMTItMDhcIixcImlub2N1bGF0aW9uaW5zdGl0dXRpb25uYW1lXCI6XCLlvIDlubPluILplb/mspnooZfpgZPlip7kuovlpITnpL7ljLrljavnlJ/mnI3liqHkuK3lv4PvvIjkuJzlhbTvvInpooTpmLLmjqXnp43pl6jor4pcIixcImlub2N1bGF0aW9uZGF0ZVwiOlwiMjAyMi0wMi0wOCAwMDowMDowMFwiLFwiaWRjYXJkbm9cIjpcIjQ0MDc4MzIwMDIwNjEzNjYyMlwiLFwiaW5vY3VsYXRpb250eXBlbmFtZVwiOlwiaW5vY3VsYXRpb250eXBlbmFtZVwiLFwiaGVhbHRoZWNvZGVcIjpcImhlYWx0aGVjb2RlXCIsXCJ2YWNjaW5lbmFtZVwiOlwi5paw5Z6L5Yag54q255eF5q+S54Gt5rS755ar6IuX77yIVmVyb+e7huiDnu+8iVwiLFwibmVlZGxldGltZXNcIjpcIjNcIixcInZhY2NpbmVtYW51ZmFjdHVyZXJuYW1lXCI6XCLljJfkuqznp5HlhbTkuK3nu7RcIixcImlub2N1bGF0aW9ucGxhY2VcIjpcIuW8gOW5s+W4gumVv+aymeihl+mBk+WKnuS6i+WkhOekvuWMuuWNq+eUn+acjeWKoeS4reW/g++8iOS4nOWFtO+8iemihOmYsuaOpeenjemXqOivilwiLFwibmFtZVwiOlwi5p6X6ZSm5a6BXCJ9XX0sXCJlcnJtc2dcIjpcIlwifX0se1wiaWRlbnRpdHlfcmVzdWx0XCI6e1wiaWRlbnRpdHlcIjpcIjQ0MDc4MzIwMDIwNjEzNjYyMlwifX1dIn0=";
		YctDataVo r=YctDataParse.parse(td);
		System.out.println(r);
	}
}
